package com.pactera.madp.cp.config;

import com.pactera.madp.cp.interceptor.AuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer{

    private static final String[] excludePaths = {
            "/corp",
            "/corp/bind",
            "/wework/**",
            "/agent/**",
            "/employeedo/**",
            "/employeefollow/**",
            "/employeewechat/**",
            "/employee-info/**",
            "/marketingarticlewechat/**",
            "/marketingclassificationwechat/**",
            "/marketingexcelwechat/**",
            "/marketinghotwechat/**",
            "/marketinglinkwechat/**",
            "/marketingpdfwechat/**",
            "/marketingposterwechat/**",
            "/marketingpptwechat/**",
            "/marketingrecwechat/**",
            "/marketingwordwechat/**",
            "/contactfieldpivotwechat/**",
            "/workcontactwechat/**",
            "/workcontacttaggroupwechat/**",
            "/mediumwechat/**",
            "/productwechat/**",
            "/prodwechat/**",
            "/productgroupwechat/**",
            "/behavior-track/**",
            "/daily/**",
            "/workemployeewechat/**",
            "/upload/**",
            "/employee-data-panel/**",
            "/contact-radar/**",
            "/workEmployeeOperate/**",
            "/wx-mp/**",
            "/cuqc/**",
            "/product-employee-wechat/**",
            "/sys-file/upload",
            "/add-customer/**",
            "/sync/**",
            "/managerview-customer-wechat/**",
            "/add-customer-wechat/**",
            "/employee-marketing-event-remind/**",
            "/info/**",
            "/redpack/**"

    };

    @Autowired
    private AuthorityInterceptor authorityInterceptor;

    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authorityInterceptor).excludePathPatterns(excludePaths);
    }

}
